home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / apps / 604 / printers / pscript.hdr < prev    next >
Text File  |  1992-06-17  |  17KB  |  802 lines

  1. %%BeginProlog
  2. % $VER: 2.2.9 04/06/92
  3. %Copyright 1991-1992 Soft-Logik Publishing Corp.
  4.  
  5. /AsphaltDict dup 153 dict def load begin
  6.  
  7. %
  8. % some definitions & variables
  9. %
  10. /bdef {bind def} bind def
  11. /xdef {exch def} bdef
  12. /ldef {load def} bdef
  13. /SG /setgray ldef
  14. /dmatrix matrix def
  15. /cmatrix matrix def
  16. /omatrix matrix def
  17.  
  18. /deltax 0 def
  19. /deltay 0 def
  20. /slant 0 def
  21. /twist 0 def
  22. /xscl 0 def
  23. /yscl 0 def
  24. /eang 0 def
  25. /bang 0 def
  26. /NwScrn false def
  27.  
  28. %
  29. % drawing definitions
  30. %
  31.  
  32. /sclm [0 0 0 0 0 0] def
  33. /setscl {
  34.   /deltay exch neg def
  35.   /deltax exch neg def
  36.   100 div /twist xdef
  37.   100 div /slant xdef
  38.   cmatrix setmatrix deltax neg deltay neg translate
  39.   sclm 0 twist cos put
  40.   sclm 1 twist sin put
  41.   sclm 2 slant sin neg put
  42.   sclm 3 slant cos put
  43.   sclm concat
  44.   /omatrix omatrix currentmatrix def
  45. } bdef
  46.  
  47. /scl {
  48.  deltay add exch
  49.  deltax add exch
  50.  transform round .2 add exch round .2 add exch itransform
  51. } bdef
  52.  
  53. /NW {newpath} bdef
  54. /MT {scl moveto} bdef
  55. /LT {scl lineto} bdef
  56. /CRV {scl 6 2 roll scl 6 2 roll scl 6 2 roll curveto} bdef
  57.  
  58. /AT {
  59.   100 div /eang xdef 100 div /bang xdef
  60.   /yscl xdef /xscl xdef scl translate
  61.   xscl yscl scale 0 0 1 bang eang
  62.   arc omatrix setmatrix
  63. } bdef
  64.  
  65. /AN {
  66.   100 div /eang xdef 100 div /bang xdef
  67.   /yscl xdef /xscl xdef scl translate
  68.   xscl yscl scale 0 0 1 bang eang
  69.   arcn omatrix setmatrix
  70. } bdef
  71.  
  72. /CP {closepath} bdef
  73.  
  74. /LTYPE {0 setdash setlinewidth} bdef
  75.  
  76. %
  77. % - BeginDoc -
  78. %
  79. /BeginDoc {
  80.   7 dict begin
  81.     /FontDict 12 dict def
  82.     FontDict begin
  83.       /cache true def
  84.       /key /mypatternfont def
  85.       /patterns 256 array def
  86.       /patterncount 1 def
  87.       /char 1 def
  88.       /mtx [300 72 div 0 0 300 72 div 0 0] matrix invertmatrix def
  89.       /height 30 def
  90.       /width 30 def
  91.       /ctm matrix currentmatrix def
  92.       /ptm matrix identmatrix def
  93.       /str ( ) def
  94.     end
  95.     /FontBBox [0 0 FontDict /width get FontDict /height get] def
  96.     /FontMatrix FontDict /mtx get def
  97.     /Encoding 256 array 0 1 255 {1 index exch dup put} for def
  98.     /FontType 3 def
  99.     /BuildChar { %def
  100.       exch begin
  101.       FontDict begin
  102.       /char xdef
  103.       cache
  104.         {width 0 0 0 width height setcachedevice}
  105.         {width 0 setcharwidth}
  106.       ifelse
  107.       width height scale 16 16 true [16 0 0 -16 0 16] {patterns char get} imagemask
  108.       end end
  109.     } def
  110.     FontDict /key get currentdict definefont pop
  111.   end
  112.  
  113. }bdef
  114.  
  115. %
  116. % angle cx cy cropmark -
  117. %
  118. /cropmark {
  119.   gsave translate rotate
  120.   newpath
  121.   bh 6 add 0 moveto 20 0 rlineto
  122.   0 bv 6 add moveto 0 20 rlineto
  123.   stroke grestore
  124. } bdef
  125.  
  126. %
  127. % cx cy regmark -
  128. %
  129. /regmark {
  130.   gsave translate
  131.   newpath
  132.   10 0 moveto 0 0 10 0 360 arc
  133.   1 SG fill
  134.   8 0 moveto 0 0 8 0 360 arc
  135.   -10 0 moveto 10 0 lineto 0 -10 moveto 0 10 lineto
  136.   0 SG stroke
  137.   4 0 moveto 0 0 4 0 360 arc
  138.   fill
  139.   -4 0 moveto 4 0 lineto 0 -4 moveto 0 4 lineto
  140.   1 SG stroke
  141.   grestore
  142. } bdef
  143.  
  144. %
  145. % cx cy slurgauge -
  146. %
  147. /slurgauge {
  148.   gsave translate
  149.   newpath
  150.   0 0 10 0 360 arc
  151.   1 SG fill
  152.   0 0 10 0 360 arc
  153.   0 SG stroke
  154.   36 { 1 0 moveto 0 0 10 -2.5 2.5 arc fill 10 rotate} repeat
  155.   grestore
  156. } bdef
  157.  
  158. %
  159. % string cx cy label -
  160. %
  161. /label {
  162.   gsave translate 90 rotate
  163.   /Courier findfont 8 scalefont setfont
  164.   0 0 moveto show
  165.   0 -8 moveto
  166.   currentscreen pop exch 20 string cvs show ( lpi  ) show
  167.   20 string cvs show (\312   ) show
  168.   docscale 20 string cvs show (%) show
  169.   grestore
  170. } bdef
  171.  
  172. %
  173. % angle cx cy colorstrip -
  174. %
  175. /boxit {newpath moveto 14 0 rlineto 0 -14 rlineto -14 0 rlineto closepath} def
  176.  
  177. /colorstrip {
  178.   gsave translate rotate
  179.   /Courier findfont 6 scalefont setfont
  180.  
  181.   psepmode 0 eq {
  182.     0 8 translate
  183.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill} for
  184.    }if
  185.  
  186.   psepmode 1 eq {
  187.     gsave 320 15 translate
  188.     0 0 boxit .5 .41 .41 0 setcmykcolor fill
  189.     15 0 boxit 0 0 0 .5 setcmykcolor fill
  190.     30 0 boxit 1 1 0 0 setcmykcolor fill
  191.     45 0 boxit 1 0 1 0 setcmykcolor fill
  192.     60 0 boxit 0 1 1 0 setcmykcolor fill
  193.     75 0 boxit 1 1 1 0 setcmykcolor fill
  194.     1 SG
  195.     33 -6 moveto (CM) show
  196.     48 -6 moveto (CY) show
  197.     63 -6 moveto (MY) show
  198.     77 -6 moveto (CMY) show
  199.     grestore
  200.  
  201.     
  202.     pblack 0 ne {0 15 translate (K)} if
  203.     pcyan 0 ne {0 0 translate (C)} if
  204.     pmagenta 0 ne {160 15 translate (M)} if
  205.     pyellow 0 ne {160 0 translate (Y)} if
  206.     -6 -6 moveto 0 SG show
  207.  
  208.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill} for
  209.    }if
  210.  
  211.   psepmode 2 eq {
  212.     320 0 translate
  213.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill} for
  214.    }if
  215.  
  216.   grestore
  217. } def
  218.  
  219. %
  220. % tilestring sepmode cyan magenta yellow black
  221. % negative mirror cropmarks manualfeed landscape scale
  222. % documentwidth documentheight paperw paperh tilex tiley tilew tileh
  223. % bh bv frequency angle copies iseps BEGINTILE
  224. %
  225. /begintile {
  226.   /iseps xdef
  227.   /#copies xdef
  228.   /cangle xdef
  229.   /cfreq xdef
  230.   /bv xdef
  231.   /bh xdef
  232.   /tileh xdef
  233.   /tilew xdef
  234.   /tiley xdef
  235.   /tilex xdef
  236.   /paperh xdef
  237.   /paperw xdef
  238.   /doch xdef
  239.   /docw xdef
  240.   /docscale xdef
  241.   /landscape xdef
  242.   /manual xdef
  243.   /cropmarks xdef
  244.   /mirror xdef
  245.   /negative xdef
  246.   /pblack xdef
  247.   /pyellow xdef
  248.   /pmagenta xdef
  249.   /pcyan xdef
  250.   /psepmode xdef
  251.   /tilename xdef
  252.  
  253.   /dmatrix dmatrix currentmatrix def
  254.  
  255.   bh 0 ge {/bleed true def}{/bleed false def /bh 0 def /bv 0 def}ifelse
  256.  
  257.   iseps {
  258.    /cropmarks false def
  259.    /bleed false def /bh 0 def bv 0 def
  260.    /mirror false def
  261.    /negative false def
  262.    /manual false def
  263.   }
  264.   {
  265.    statusdict /setpageparams known
  266.     {
  267.      mirror {statusdict /mirrorprint known {statusdict /mirrorprint true put /mirror false def}if }if
  268.      negative {statusdict /negativeprint known {statusdict /negativeprint true put /negative false def}if }if
  269.      statusdict begin tileh tilew cropmarks {72 add exch 72 add exch}if 0 0 setpageparams end
  270.     }
  271.     {
  272.      paperw 612 eq paperh 1008 eq and {legal} if
  273.      paperw 612 eq paperh 792 eq and {letter} if
  274.     } ifelse
  275.   } ifelse
  276.  
  277.   /leftclip paperw tilew cropmarks {72 add bh 2 mul add}if sub 2 div def
  278.   /topclip paperh tileh cropmarks {72 add bv 2 mul add}if sub 2 div def
  279.   leftclip topclip translate
  280.  
  281.   mirror {docw 0 translate -1 1 scale} if
  282.   negative {{1 exch sub} settransfer newpath clippath 1 SG fill} if
  283.   manual {statusdict /manualfeed known {statusdict /manualfeed true put}if }if
  284.   tilex neg tiley neg translate
  285.  
  286.   currentscreen /dproc xdef /dangle xdef /dfreq xdef
  287.   /dtrans currenttransfer def
  288.  
  289.   cangle 10000 gt {/cangle dangle def} if
  290.   cfreq 10000 gt {/cfreq dfreq def} if
  291.   cfreq cangle /dproc load setscreen
  292.  
  293.  
  294.  psepmode 0 eq {systemdict /setcmykcolor known not
  295.    {/setcmykcolor
  296.     {1 sub 4 1 roll 3 {3 index add neg dup 0 lt{pop 0}if 3 1 roll}
  297.      repeat setrgbcolor pop} bdef}if
  298.    /setgray /SG load def
  299.  } if
  300.  psepmode 1 eq {
  301.   pcyan 0 ne {/setcmykcolor {pop pop pop 1 exch sub SG}bdef /setgray {pop 1 SG}bdef } if
  302.   pmagenta 0 ne {/setcmykcolor {pop pop 1 exch sub SG pop}bdef /setgray {pop 1 SG}bdef } if
  303.   pyellow 0 ne {/setcmykcolor {pop 1 exch sub SG pop pop}bdef /setgray {pop 1 SG}bdef } if
  304.   pblack 0 ne {/setcmykcolor {1 exch sub SG pop pop pop}bdef /setgray /SG load def } if
  305.  } if
  306.  psepmode 2 eq {/setcmykcolor {
  307.   pblack 10000 div eq exch
  308.   pyellow 10000 div eq and exch
  309.   pmagenta 10000 div eq and exch
  310.   pcyan 10000 div eq and {0 SG}{1 SG}ifelse}bdef
  311.   pblack 10000 eq pyellow 0 eq and pmagenta 0 eq and pcyan 0 eq and
  312.    {/setgray /SG load def}{/setgray {pop 1 SG} bdef} ifelse
  313.  } if
  314.  
  315.  
  316.   cropmarks {
  317.     mirror {bh 36 add neg bv 36 add translate}{bh 36 add bv 36 add translate}ifelse
  318.     gsave
  319.     0 SG [] 0 setdash .3 setlinewidth 0 setlinejoin 0 setlinecap
  320.  
  321.     180 tilex tiley cropmark
  322.     270 tilex tilew add tiley cropmark
  323.     0 tilex tilew add tiley tileh add cropmark
  324.     90 tilex tiley tileh add cropmark
  325.  
  326.     tilew 2 div tilex add 18 tiley add tileh add bv add regmark
  327.     tilew 2 div tilex add -18 tiley add bv sub regmark
  328.  
  329.     tilex bh sub 18 sub tiley bv sub 18 sub slurgauge
  330.     tilex tilew add bh add 18 add tiley tileh add bv add 18 add slurgauge
  331.  
  332.     tilename tilex bh sub 18 sub tiley 18 add label
  333.  
  334.     90 tilex tilew add bh add 18 add tiley 18 add colorstrip
  335.  
  336.     grestore
  337.   } if
  338.  
  339.   bleed {
  340.     tilex bh sub tiley bv sub moveto
  341.     tilex tilew add bh add tiley bv sub lineto
  342.     tilex tilew add bh add tiley tileh add bv add lineto
  343.     tilex bh sub tiley tileh add bv add lineto
  344.     clip
  345.   } if
  346.  
  347.   landscape {-90 rotate doch neg 0 translate} if
  348.   docscale 10000.0 div dup scale
  349.  
  350.   /cmatrix cmatrix currentmatrix def
  351.   /NwScrn false def
  352.  
  353. } bdef
  354.  
  355. %
  356. %
  357. %
  358. /endtile {
  359.   manual {statusdict /manualfeed known {statusdict /manualfeed false put}if } if
  360.   dmatrix setmatrix
  361. } bdef
  362.  
  363.  
  364. %
  365. % - patternpath -
  366. %
  367. /patternpath { %def
  368.   /mypatternfont findfont begin FontDict /ctm get setmatrix
  369.   currentdict setfont
  370.  
  371.   FontDict begin
  372.     FontMatrix concat
  373.     width 0 dtransform
  374.     round width div exch round width div exch
  375.     0 height dtransform
  376.     round height div exch
  377.     round height div exch
  378.     0 0 transform round exch round exch
  379.     ptm astore setmatrix
  380.     pathbbox
  381.     height div ceiling height mul 4 1 roll
  382.     width div ceiling width mul 4 1 roll
  383.     height div floor height mul 4 1 roll
  384.     width div floor width mul 4 1 roll
  385.     2 index sub height div ceiling cvi exch
  386.     3 index sub width div ceiling cvi exch
  387.     4 2 roll moveto
  388.     FontMatrix ptm invertmatrix pop
  389.     { %repeat
  390.       gsave
  391.       ptm concat
  392.       dup {str show} repeat
  393.       grestore
  394.       0 height rmoveto
  395.     } repeat
  396.     pop
  397.   end end
  398. } bdef
  399.  
  400. %
  401. % - patternfill -
  402. %
  403. /patternfill { %def
  404.  
  405.   gsave
  406.   1 setgray
  407.   fill
  408.   grestore
  409.  
  410.   gsave
  411.   clip patternpath
  412.   grestore
  413.   newpath
  414. } bdef
  415.  
  416. %
  417. % - patternfill -
  418. %
  419. /patterneofill { %def
  420.  
  421.   gsave
  422.   1 setgray
  423.   fill
  424.   grestore
  425.  
  426.   gsave
  427.   eoclip patternpath
  428.   grestore
  429.   newpath
  430. } bdef
  431.  
  432. /patternstroke {
  433.     strokepath patternfill
  434. } bdef
  435.  
  436.  
  437. %
  438. % ax ay string patternashow -
  439. %
  440. /patternashow {
  441.   (0) exch 
  442.   { %forall
  443.     2 copy 0 exch put pop dup
  444.     false charpath 
  445.     currentpoint
  446.     patternfill
  447.     moveto
  448.     3 copy pop rmoveto
  449.   } forall
  450.   pop pop pop
  451. } bdef
  452.  
  453. %
  454. % string patternshow -
  455. %
  456. /patternshow {
  457.   (0) exch 
  458.   { %forall
  459.     2 copy 0 exch put pop dup
  460.     false charpath 
  461.     currentpoint
  462.     patternfill
  463.     moveto
  464.   } forall
  465.   pop
  466. } bind def
  467.  
  468.  
  469. %
  470. % <pattern> shade PTRN -
  471. %
  472. /PTRN {
  473.   /shade xdef
  474.   /pattern xdef
  475.   /mypatternfont findfont begin
  476.   FontDict begin
  477.   true
  478.   1 1 patterncount {
  479.     dup patterns exch get pattern eq
  480.       {str exch 0 exch put pop false exit}
  481.     if
  482.     pop
  483.   }for
  484.   {
  485.     patterns patterncount pattern put
  486.     str 0 patterncount put
  487.     /patterncount patterncount 1 add def
  488.   }if
  489.   end
  490.   end
  491.  
  492.   /MF {gsave patterneofill grestore} bdef
  493.   /MS {gsave patternstroke grestore} bdef
  494.   /SW {patternshow} bdef
  495.  
  496.   1 shade 10000 div sub SG
  497. } bdef
  498.  
  499.  
  500.  
  501. %
  502. % shade SHADE -
  503. %
  504. /SHADE {
  505.   /shade xdef
  506.   NwScrn {
  507.     cfreq cangle /dproc load setscreen
  508.     /NwScrn false def
  509.   }if
  510.  
  511.   /MF {gsave eofill grestore} bdef
  512.   /MS {gsave stroke grestore} bdef
  513.   /SW /show ldef
  514.  
  515.   1 shade 10000 div sub SG
  516. } bdef
  517.  
  518. %
  519. %
  520. %
  521. /CMYK {
  522.   /k xdef
  523.   /y xdef
  524.   /m xdef
  525.   /c xdef
  526.   c 10000 div m 10000 div y 10000 div k 10000 div setcmykcolor
  527. } bdef
  528.  
  529.  
  530. %
  531. % pixelw pixelh bitsperpixel picx picy pfreq pangle PUTPIC savestate
  532. %
  533. /putpic {
  534.   /pangle xdef
  535.   /pfreq xdef
  536.   /ysize xdef
  537.   /xsize xdef
  538.   /bpp xdef
  539.   /h xdef
  540.   /w xdef
  541.  
  542.   pfreq 10000 lt {pfreq}{cfreq} ifelse
  543.   pangle 10000 lt {pangle}{cangle} ifelse
  544.   /dproc load setscreen
  545.   xsize 2 div neg ysize 2 div neg translate
  546.   xsize ysize scale
  547.   /NwScrn true def
  548.  
  549.   save
  550.   /picstr 8 bpp idiv dup w add 1 sub exch idiv string def
  551.   w h bpp [w 0 0 h neg 0 h] {currentfile picstr readhexstring pop}bind image
  552. } bdef
  553.  
  554. %
  555. % pixelw pixelh bitsperpixel picx picy pfreq pangle PUTRGBPIC savestate
  556. %
  557. /putrgbpic {
  558.   /pangle xdef
  559.   /pfreq xdef
  560.   /ysize xdef
  561.   /xsize xdef
  562.   /bpp xdef
  563.   /h xdef
  564.   /w xdef
  565.  
  566.   pfreq 10000 lt {pfreq}{cfreq} ifelse
  567.   pangle 10000 lt {pangle}{cangle} ifelse
  568.   /dproc load setscreen
  569.   xsize 2 div neg ysize 2 div neg translate
  570.   xsize ysize scale
  571.   /NwScrn true def
  572.  
  573.   save
  574.   /picstr 8 bpp idiv dup w add 1 sub exch idiv string def
  575.   w h bpp [w 0 0 h neg 0 h]  {currentfile picstr readhexstring pop}bind false 3 colorimage
  576. } bdef
  577.  
  578. %
  579. % savestate ENDPIC -
  580. %
  581. /endpic {
  582.   restore
  583. } bdef
  584.  
  585. %
  586. % newx newy origx origy llx lly urx ury BGNEPS -
  587. %
  588. /bgneps {
  589.   /ury xdef
  590.   /urx xdef
  591.   /lly xdef
  592.   /llx xdef
  593.   /origy xdef
  594.   /origx xdef
  595.   /newy xdef
  596.   /newx xdef
  597.   100 newx origx div mul 100 newy origy div mul scale
  598.   urx llx add -2 div ury lly add -2 div translate
  599.   /PgsEpsSave save def /showpage {} bdef
  600.   llx lly moveto llx ury lineto urx ury lineto urx lly lineto clip
  601.   newpath [] 0 setdash 1 setlinewidth 0 SG
  602. } bdef
  603.  
  604. %
  605. % - ENDEPS -
  606. %
  607. /endeps {PgsEpsSave restore} bdef
  608.  
  609.  
  610. %
  611. %
  612. %
  613. /doendstyle {
  614.   scl /taily exch def /tailx exch def
  615.   scl /tipy exch def /tipx exch def
  616.   gsave newpath 1 eq
  617.   {
  618.     /halfhead currentlinewidth dup 125 gt {1.5}{2} ifelse mul def
  619.     /headlength halfhead 5 mul def
  620.     /dx tipx tailx sub def
  621.     /dy tipy taily sub def
  622.     /arrowlength dx dx mul dy dy mul add sqrt def
  623.     /angle dy dx atan def
  624.     /base arrowlength headlength sub def
  625.     tailx taily translate
  626.     angle rotate
  627.     base halfhead neg moveto
  628.     arrowlength 0 lineto
  629.     base halfhead lineto
  630.     closepath fill
  631.     base 0 transform
  632.   }
  633.   {
  634.     tipx tipy currentlinewidth 2 div 0 360 arc fill
  635.     tipx tipy transform
  636.   } ifelse
  637.   grestore itransform} bdef
  638.   /BS {doendstyle moveto} bdef
  639.   /ES {doendstyle lineto MS} bdef
  640.  
  641.  
  642. %
  643. % font xpoint ypoint attribute SETFP
  644. %
  645. /sfpm [0 0 0 0 0 0] def
  646. /setfp {
  647.   /curattr xdef /curypoint xdef /curxpoint xdef /curfont xdef
  648.  
  649.   sfpm 0 curxpoint put
  650.   sfpm 3 curypoint put
  651.   curfont findfont sfpm
  652.   dup 2 0 put
  653.   2 curattr and 0 ne {dup 2 curypoint 3 div put} if
  654.   16 curattr and 0 ne {dup 2 curypoint 3 div neg put} if
  655.   128 curattr and 0 ne {dup 0 curxpoint neg put} if
  656.   256 curattr and 0 ne {dup 3 curypoint neg put} if
  657.   makefont setfont
  658. } bdef
  659.  
  660. %
  661. % - FONTSAVE -
  662. %
  663. /fontsave {
  664.   /PgsFontSave save def
  665. } bdef
  666.  
  667. %
  668. % - FONTRESTORE -
  669. %
  670. /fontrestore {
  671.   currentgray slant 100 mul twist 100 mul deltax neg deltay neg
  672.   PgsFontSave restore
  673.   setscl setgray
  674. } bdef
  675.  
  676. %
  677. % - PAGESAVE -
  678. %
  679. /pagesave {
  680.   /PgsPageSave save def
  681. } bdef
  682.  
  683. %
  684. % - PAGERESTORE -
  685. %
  686. /pagerestore {
  687.   PgsPageSave restore
  688. } bdef
  689.  
  690. %
  691. % cwidth A -
  692. %
  693. /a {/cwidth xdef
  694.  
  695. % reverse
  696.  64 curattr and 0 ne
  697.   {gsave 0 curypoint .75 mul rmoveto cwidth 0 rlineto
  698.    0 curypoint neg rlineto cwidth neg 0 rlineto closepath fill grestore
  699.    gsave 1 SG } if
  700.  
  701. % underline
  702.  512 curattr and 0 ne
  703.   {curypoint 40 div setlinewidth [] 0 setdash
  704.    gsave 0 curypoint .05 mul neg rmoveto
  705.    cwidth 0 rlineto stroke grestore} if
  706.  
  707. % double underline
  708.  4096 curattr and 0 ne
  709.   {curypoint 40 div setlinewidth [] 0 setdash
  710.    gsave 0 curypoint .05 mul neg rmoveto
  711.    cwidth 0 rlineto stroke grestore
  712.    gsave 0 curypoint .15 mul neg rmoveto
  713.    cwidth 0 rlineto stroke grestore} if
  714.  
  715. % strike through
  716.  8192 curattr and 0 ne
  717.   {curypoint 40 div setlinewidth [] 0 setdash
  718.    gsave 0 curypoint .3 mul rmoveto
  719.    cwidth 0 rlineto stroke grestore} if
  720. %
  721.  64 curattr and 0 ne
  722.    {grestore} if
  723.  
  724.  } bdef
  725.  
  726. %
  727. % cwidth newx newy B -
  728. %
  729. /b {newpath scl moveto a} bdef
  730.  
  731. %
  732. % cchar cwidth R -
  733. %
  734. /r {/cwidth xdef /cchar xdef
  735.  
  736. gsave
  737.  
  738. curattr 0 eq {cchar SW}
  739. {
  740. % reverse
  741.  64 curattr and 0 ne
  742.    {1 SG} if
  743.  
  744. % shadow
  745.  4 curattr and 0 ne
  746.   {curypoint 160 div setlinewidth [] 0 setdash
  747.    32 curattr and 0 ne
  748.   {64 curattr and 0 ne
  749.    {gsave .5 SG curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  750.     gsave cchar SW grestore}
  751.    {gsave currentgray 1 add .5 mul SG curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  752.     gsave cchar SW grestore} ifelse
  753.    }
  754.  
  755.   {64 curattr and 0 ne
  756.    {gsave curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  757.     gsave 0 SG cchar SW grestore
  758.     gsave cchar true charpath stroke grestore}
  759.    {gsave curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  760.     gsave 1 SG cchar SW grestore
  761.     gsave cchar true charpath stroke grestore} ifelse
  762.    } ifelse
  763.   } if
  764.  
  765. % outline
  766.  8 curattr and 0 ne
  767.   {curypoint 160 div setlinewidth [] 0 setdash
  768.    64 curattr and 0 eq {gsave 1 SG cchar SW grestore} if
  769.    gsave cchar true charpath stroke grestore} if
  770.  
  771. % light
  772.  32 curattr and 0 ne
  773.   {64 curattr and 0 ne {.5} {currentgray 1 add .5 mul} ifelse SG} if
  774.  
  775. % mirror
  776.  128 curattr and 0 ne
  777.   {cchar stringwidth pop neg 0 rmoveto} if
  778.  
  779. % upside down
  780.  256 curattr and 0 ne
  781.   {0 curypoint .6 mul rmoveto} if
  782.  
  783. %
  784.  curattr 12 and 0 eq
  785.   { curattr 1 and 0 ne
  786.     {curxpoint 48 div dup neg -10 exch
  787.       {gsave 0 rmoveto cchar SW grestore} for}
  788.     {cchar SW}ifelse
  789.   }if
  790. } ifelse
  791.  
  792.  grestore cwidth 0 rmoveto} bdef
  793.  
  794. %
  795. % cchar cwidth newx newy P -
  796. %
  797. /p {newpath scl moveto r} bdef
  798.  
  799.  
  800. end
  801. %%EndProlog
  802.